package com.quad.innovators.salesease.converter;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.quad.innovators.salesease.common.result.PageResultBean;
import com.quad.innovators.salesease.model.entity.task.TaskDistribution;
import com.quad.innovators.salesease.model.entity.warehouse.VehicleBringGoods;
import com.quad.innovators.salesease.model.form.task.TaskDistributionForm;
import com.quad.innovators.salesease.model.form.warehouse.VehicleBringGoodsForm;
import com.quad.innovators.salesease.model.vo.task.TaskDistributionVO;
import com.quad.innovators.salesease.model.vo.warehouse.VehicleBringGoodsVO;

import org.mapstruct.InheritInverseConfiguration;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.springframework.stereotype.Component;

/**
 * @author : shanshan.li
 * @createTime : 2025/4/7 10:12
 * @Version : 1.0 
 */
@Mapper(componentModel = "spring")
public interface VehicleBringGoodsConverter {

    @Mappings({
            @Mapping(target = "items", source = "records"),
            @Mapping(target = "pageInfo.currPage", source = "current"),
            @Mapping(target = "pageInfo.totalCount", source = "total"),
            @Mapping(target = "pageInfo.pageSize", source = "size")
    })
    PageResultBean<VehicleBringGoodsVO> toPageVo(Page<VehicleBringGoodsVO> bo);

    VehicleBringGoodsForm toForm(VehicleBringGoods entity);

    @InheritInverseConfiguration(name = "toForm")
    VehicleBringGoods toEntity(VehicleBringGoodsForm entity);
}
